#include <lapacke.h>
#include <vector>
#include <iostream>
#include <cmath>
#include "Splines.h"

class f
{
public:
    double operator()(double x)
	{
	    double y;
	    y = 1/(1+x*x);
	    return y;
	};
};

class T1
{
public:
    double operator()(double x)
	{
	    double y;
	    y = x - 6;
	    return y;
	};
};

class T2
{
public:
    double operator()(double x)
	{
	    double y;
	    y = x - 5.5;
	    return y;
	};
};
    

int main()
{
    vector<double> X1,X2,Y1,Y2;
    X1.resize(11+6);
    Y1.resize(11+6);
    X2.resize(10+4);
    Y2.resize(10+4);
    T1 T1;
    T2 T2;
    f f;
    for (int i = 0; i <= 11+5; i++)
    {
	X1[i] = T1(i-2);
	Y1[i] = f(X1[i]);
    }
    for (int i = 0; i <= 10+3; i++)
    {
	X2[i] = T2(i-1);
	Y2[i] = f(X2[i]);
    }
    Bsplines B1(X1,Y1), B2(X2,Y2);
    double a1,a2;
    a1 = B1.solve_3(0.0056, -0.014792899, 0);
    a2 = B2.solve_2(0.047058823, 0.047058823, 0);
    cout << a1 << " " << a2 << endl;
}
